
{% extends "base.html" %}

{%block title%}
Login
{%endblock%}

{% block content %}
{% if user.is_authenticated %}
	<center><h2>You are already logged in!</h2></center>
{%else%}
<center>
<h2>Login to {{site}}</h2>
  {% if form.errors %}
    <p class="error">Sorry, that's not a valid username or password</p>
  {% endif %}

  <form action='.' method='post'>
  {% csrf_token %}
  <table style="width:250px;">
  <tr><td>
    <label for="username">User name:</label>
    </td><td>
    <input type="text" name="username" value="" id="username">
    </td></tr><tr><td>
    <label for="password">Password:</label>
    </td><td>
    <input type="password" name="password" value="" id="password">
	</td></tr><tr><td>
    <input type="submit" value="login" />
    </td><td>
    <input type="hidden" name="next" value="{{next}}" />
    </td></tr>
    </table>
  <form action='.' method='post'>
</center>
{%endif%}

<center>New to {{site}}?<br>
<a href="/accounts/register/">Register</a> a new account. It's free.</center>
{% endblock %}